
var sftp = require('gulp-sftp')
var gulp = require('gulp')
var chalk = require('chalk')

let remoteServers = [
  {
    host: '39.105.141.124',
    remotePath: '/home/nodepro/bigdata/bigdata-web-manager-dist',
    user: 'root',
    pass: 'asdASD123'
  }
]

remoteServers.forEach(remoteServer => {
  // gulp.src(config.build.assetsRoot + '/../temp/**')
  gulp.src('./dist' + '/**')
    .pipe(sftp(remoteServer))
})

// var remoteServer = {
//   host: '42.51.192.245',
//   remotePath: '/www/projects/zyh5/dist',
//   user: 'root',
//   pass: 'yxdsuper123'
// };

// gulp.src(config.build.assetsRoot + '/**')
//     .pipe(sftp(remoteServer))
console.log(chalk.yellow(
  '  Tip: built files are meant to be served over an HTTP server.\n' +
      '  Opening index.html over file:// won\'t work.\n'
))
